package top.aicey.ai.sparring.service.impl;

import java.util.List;
import java.util.Objects;

import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import top.aicey.ai.sparring.common.constants.EntityConstants;
import top.aicey.ai.sparring.entity.SceneQaPairs;
import top.aicey.ai.sparring.mapper.SceneQaPairsMapper;
import top.aicey.ai.sparring.service.ISceneQaPairsService;

/**
 * <p>
 * 场景问答对 服务实现类
 * </p>
 *
 * @author 白杨
 * @since 2025-01-14
 */
@Service
public class SceneQaPairsServiceImpl extends ServiceImpl<SceneQaPairsMapper, SceneQaPairs>
    implements ISceneQaPairsService {
    @Override
    public List<SceneQaPairs> listBySceneId(String moduleId, Long sceneId) {
        return this.list(Wrappers.query(SceneQaPairs.class)
            .eq(Objects.nonNull(moduleId),EntityConstants.MODULE_ID,moduleId)
            .eq(Objects.nonNull(sceneId),EntityConstants.SCENE_ID,sceneId));
    }

}
